package com.zmn.oms.persistence.interfaces.post;

import com.zmn.oms.model.entity.post.OrderPost;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 类描述：订单快递信息
 *
 * @author xiaofei
 * @date 2020-7-27
 */
public interface OrderPostDao {

    /**
     * 根据快递单号和快递公司编码查询订单id
     * @param expressCode 
     * @param expressCompanyCode 
     * @return java.lang.Long
     * @author wangxiaokun
     */
    Long findOrderIdByExpressCodeAndExpressCompanyCode(@Param("expressCode") String expressCode,
                                                       @Param("expressCompanyCode") String expressCompanyCode);

    /**
     * 根据订单号查找快递信息
     *
     * @param orderId
     * @return List<OrderPost>
     */
    List<OrderPost> listOrderPostByOrderId(Long orderId);

    /**
     * 根据订单号查找不可更改的快递信息
     *
     * @param orderId
     * @return List<OrderPost>
     */
    List<OrderPost> listUnModifiableOrderPostByOrderId(Long orderId);

    List<OrderPost> listOrderPostByOrderIds(@Param("orderIdList") List<Long> orderIdList);

    /**
     * 添加快递信息
     *
     * @param orderPost
     * @return int
     */
    int insertOrderPost(OrderPost orderPost);

    int insertOrderPostList(List<OrderPost> orderPostList);

    /**
     * 删除物流记录
     *
     * @param orderId
     * @return int
     */
    int deleteOrderPostByOrderId(Long orderId);

    /**
     * 更新物流快递信息
     *
     * @param orderPost
     * @return
     */
    int updateOrderPostExpress(OrderPost orderPost);

    /**
     * 通过主键更新物流快递信息
     *
     * @param orderPost
     * @return
     */
    int updateOrderPostExpressById(OrderPost orderPost);
}
